package main.java.jin.singleton;


/**
 * 静态内部类 实现的单例
 *
 *  JVM本身机制，静态内部类的加载已经实现了线程安全
 */



public class StaticInnerClassSingleton {

    private static class StaticInnerClass{
        private static StaticInnerClassSingleton singleton = new StaticInnerClassSingleton();
    }

    private StaticInnerClassSingleton (){

    }

    public StaticInnerClassSingleton getSingleton() {

        return StaticInnerClass.singleton;
    }
}
